/**
 * @file rect.h
 * @author ThomasKingFree (dulu150@126.com)
 * @brief
 * @version 0.1
 * @date 2021-03-21
 *
 * @copyright Copyright (c) 2021
 *
 */

#ifndef YUE_GUI_RECT_H
#define YUE_GUI_RECT_H

#include <cstdint>

namespace YueGUI {
class Rect {
public:
    Rect() = delete;
    Rect(int16_t x, int16_t y, int16_t width, int16_t height_);
    Rect(const Rect &other);
    Rect(const Rect &&other);
    ~Rect();

    void operator = (const Rect &other);
    void operator = (const Rect &&other);

    void Join(const Rect &other);

    bool Intersect(const Rect &other);

    bool Contain(const Rect &other);
private:
    int16_t originX_ = -1;
    int16_t originY_ = -1;
    int16_t width_ = 0;
    int16_t height_ = 0;
};
} // namespace YueGUI
#endif // YUE_GUI_RECT_H
